#define LED_BUILTIN 13
void setup() {
  // put your setup code here, to run once:
  pinMode(LED_BUILTIN,OUTPUT);
  Serial.begin(9600);
  delay(2000);
  Serial.write("hello");
}

void loop() {
    // put your main code here, to run repeatedly:
    char c;
    String s="";
//    Serial.println("hello");
    while(Serial.available()){
      c=Serial.read();
      s = s+c;
    }
    Serial.println(strlen(s.c_str()));
    if(strlen(s.c_str())>0){
      s.replace("\n","");
      Serial.write(s.c_str());
      if(s=="OFF"){
        digitalWrite(LED_BUILTIN,LOW);
      }
      else{
        digitalWrite(LED_BUILTIN,HIGH);
      }
      
    }
    delay(1000);
    
}